<html>

<head>
<meta name=标题 content="">
<meta name=关键词 content="">
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta name=Generator content="Microsoft Word 15 (filtered)">
<style>
<!--
 /* Font Definitions */
@font-face
	{font-family:"Courier New";
	panose-1:2 7 3 9 2 2 5 2 4 4;}
@font-face
	{font-family:Times;
	panose-1:0 0 5 0 0 0 0 2 0 0;}
@font-face
	{font-family:Wingdings;
	panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
	{font-family:宋体;}
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:DengXian;
	panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
	{font-family:"\@DengXian";}
@font-face
	{font-family:"Microsoft YaHei";
	panose-1:2 11 5 3 2 2 4 2 2 4;}
@font-face
	{font-family:Menlo;
	panose-1:2 11 6 9 3 8 4 2 2 4;}
@font-face
	{font-family:"\@宋体";}
@font-face
	{font-family:"\@Microsoft YaHei";}
@font-face
	{font-family:"MS Mincho";
	panose-1:2 2 6 9 4 2 5 8 3 4;}
@font-face
	{font-family:"\@MS Mincho";}
 /* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	font-size:12.0pt;
	font-family:DengXian;}
code
	{font-family:Courier;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
	{margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	text-indent:21.0pt;
	font-size:12.0pt;
	font-family:DengXian;}
p.a, li.a, div.a
	{margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	line-height:200%;
	font-size:12.0pt;
	font-family:"Microsoft YaHei";}
.MsoChpDefault
	{font-family:DengXian;}
 /* Page Definitions */
@page WordSection1
	{size:595.0pt 842.0pt;
	margin:72.0pt 90.0pt 72.0pt 90.0pt;
	layout-grid:15.6pt;}
div.WordSection1
	{page:WordSection1;}
 /* List Definitions */
ol
	{margin-bottom:0cm;}
ul
	{margin-bottom:0cm;}
-->
</style>

</head>

<body lang=ZH-CN style='text-justify-trim:punctuation'>

<div class=WordSection1 style='layout-grid:15.6pt'>

<p class=MsoNormal style='line-height:200%'><b><span lang=EN-US
style='font-size:14.0pt;line-height:200%;font-family:"Microsoft YaHei"'>hwclock  </span></b></p>

<p class=MsoNormal align=left style='margin-bottom:12.0pt;text-align:left;
text-indent:21.0pt;line-height:200%;text-autospace:none'><span lang=EN-US
style='font-family:"Microsoft YaHei";color:black;vertical-align:sub'>hwclock</span><span
style='font-family:"Microsoft YaHei";color:black;vertical-align:sub'>是一种访问硬件时钟的工具，可以显示当前时间，将硬件时钟设置为指定的时间，将硬件时钟设置为系统时间，以及从硬件时钟设置系统时间。您还可以定期运行<span
lang=EN-US>hwlock</span>以插入或删除硬件时钟中的时间，以补偿系统漂移<span lang=EN-US>(</span>如果继续运行，则该时钟始终以一定的速率获得或丢失时间<span
lang=EN-US>)</span>。</span></p>

<p class=MsoNormal align=left style='margin-bottom:12.0pt;text-align:left;
text-indent:21.0pt;line-height:200%;text-autospace:none'><span
style='font-family:"Microsoft YaHei";color:black;vertical-align:sub'>该命令的适用范围：<span
lang=EN-US>RedHat</span>、<span lang=EN-US>RHEL</span>、<span lang=EN-US>Ubuntu</span>、<span
lang=EN-US>CentOS</span>、<span lang=EN-US>SUSE</span>、<span lang=EN-US>openSUSE</span>、<span
lang=EN-US>Fedora</span>。</span><span style='font-family:"Microsoft YaHei"'> </span></p>

<p class=MsoNormal align=left style='margin-bottom:12.0pt;text-align:left;
text-indent:21.0pt;line-height:200%;text-autospace:none'><span lang=EN-US
style='font-family:"Microsoft YaHei"'>&nbsp;</span></p>

<p class=MsoNormal style='line-height:200%'><b><span lang=EN-US
style='font-family:"Microsoft YaHei"'>1</span></b><b><span style='font-family:
"Microsoft YaHei"'>、语法</span></b></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><b><span
lang=EN-US style='font-family:"Microsoft YaHei"'>hwclock  [functions]  [options]</span></b></p>

<p class=MsoNormal style='line-height:200%'><b><span lang=EN-US
style='font-family:"Microsoft YaHei"'>&nbsp;</span></b></p>

<p class=MsoNormal style='line-height:200%'><b><span lang=EN-US
style='font-family:"Microsoft YaHei"'>2</span></b><b><span style='font-family:
"Microsoft YaHei"'>、选项列表</span></b></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
style='font-family:"Microsoft YaHei"'>下面的选项告诉<span lang=EN-US>hwclock</span>指令该执行那个函数</span></p>

<table class=MsoTableGrid border=1 cellspacing=0 cellpadding=0 width="95%"
 style='width:95.0%;margin-left:24.1pt;border-collapse:collapse;border:none'>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  background:#E7E6E6;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>选项</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border:solid windowtext 1.0pt;
  border-left:none;background:#E7E6E6;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>说明</span></p>
  </td>
 </tr>
 <tr style='height:32.35pt'>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt;height:32.35pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>-r | --show</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt;height:32.35pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>读取硬件时钟并在标准输出上打印时间。显示的时间总是本地时间，即使您将硬件时钟保持在协调的世界时间。请参见<span
  lang=EN-US>-UTC</span>选项。</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>--set</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>将硬件时钟设置为<span
  lang=EN-US>-date</span>选项指定的时间</span></p>
  </td>
 </tr>
 <tr style='height:21.15pt'>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt;height:21.15pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>-s | --hctosys</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt;height:21.15pt'>
  <p class=MsoNormal><span style='font-family:"Microsoft YaHei"'>从硬件时钟设置系统时间。</span></p>
  <p class=MsoNormal><span style='font-family:"Microsoft YaHei"'>还将内核的时区值设置为由<span
  lang=EN-US>TZ</span>环境变量和<span lang=EN-US>/</span>或<span lang=EN-US>/usr/share/zoneinfo</span>指示的本地时区，正如<span
  lang=EN-US>tzset(3)</span>所解释的那样。内核时区值的过时的<span lang=EN-US>tz_dsttime</span>字段被设置为<span
  lang=EN-US>DST_NONE</span>。<span lang=EN-US>(</span>有关此字段过去的含义的详细信息，请参阅日期的<span
  lang=EN-US>settimeofday(2)</span>。</span></p>
  <p class=MsoNormal><span style='font-family:"Microsoft YaHei"'>这是在系统启动脚本中使用的一个很好的选项</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>-w | --systohc</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>将硬件时钟设置为当前的系统时间</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>--systz</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>根据当前时区设置内核的时区并重置系统时间，系统时间仅在启动后的第一次调用时重置。</span></p>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>本地时区被认为是<span
  lang=EN-US>TZ</span>环境变量和<span lang=EN-US>/</span>或<span lang=EN-US>/usr/share/zoneinfo</span>所指示的，<span
  lang=EN-US>tzset(3)</span>将解释它们。内核时区值的过时<span lang=EN-US>tz_dsttime</span>字段设置为<span
  lang=EN-US>DST_NONE</span>。<span lang=EN-US>(</span>有关此字段过去的含义的详细信息，请参阅日期的<span
  lang=EN-US>settimeofday(2)</span>。</span></p>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>这是<span
  lang=EN-US>-hctosys</span>的另一个选项，它不读取硬件时钟，并且可以在最近<span lang=EN-US>2.6</span>内核的系统启动脚本中使用，因为您知道系统时间包含硬件时钟时间。如果硬件时钟已经在协调时，则不会重置。</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>--adjust</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>从硬件时钟中增加或减去时间，以说明自上次时钟设置或调整以来的系统漂移。请参阅下面的讨论</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>--getepoch</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>将内核的硬件时钟时纪元打印到标准输出。这是在<span
  lang=EN-US>AD</span>中引用硬件时钟中的零年值的年份数。正在使用的约定是，硬件时钟中的年份计数器包含<span lang=EN-US>1952</span>年以来的完整年份数，然后是内核的硬件计数器时代值必须是<span
  lang=EN-US>1952</span>年。</span></p>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>每当<span
  lang=EN-US>hwlock</span>读取或设置硬件时钟时，就会使用这个纪元值。<b><span lang=EN-US>epoch</span>只有在<span
  lang=EN-US>Alpha</span>机器上有。</b></span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>--setepoch</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal align=left style='text-align:left'><span style='font-family:
  "Microsoft YaHei"'>将内核的硬件时钟纪元值设置为<span lang=EN-US>--epoch</span>选项指定的值。</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>-v | --version</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>在标准输出上显示<span
  lang=EN-US>hwclock</span>的版本</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>--date=date_string</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>如果指定<span
  lang=EN-US>-set</span>选项，则需要此选项。否则，将忽略该选项。这将指定设置硬件时钟的时间。选项是<span lang=EN-US>date</span>指令的参数。例如：<span
  lang=EN-US>hwclock --set --date=&quot;9/22/96 16:45:05&quot;</span></span></p>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>参数在本地时间，即使您将硬件时钟保持在协调的世界时间。请参见<span
  lang=EN-US>-UTC</span>选项。</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>--epoch=year</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>指定硬件时钟时代开始的年份，即在<span
  lang=EN-US>AD</span>中，硬件时钟的年份计数器中的零值所指的进入<span lang=EN-US>AD</span>的年份数。它与<span
  lang=EN-US>-setepoch</span>选项一起使用，以设置内核的硬件时钟时代概念，或者指定用于直接<span lang=EN-US>ISA</span>访问的时代。例如：</span></p>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>hwclock --setepoch --epoch=1952</span></p>
  </td>
 </tr>
</table>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
style='font-family:"Microsoft YaHei"'>下面的选项配合函数使用</span></p>

<table class=MsoTableGrid border=1 cellspacing=0 cellpadding=0 width="95%"
 style='width:95.0%;margin-left:24.1pt;border-collapse:collapse;border:none'>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  background:#E7E6E6;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>选项</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border:solid windowtext 1.0pt;
  border-left:none;background:#E7E6E6;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>说明</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>-u | --utc | --localtime</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>指示硬件时钟分别保持在协调的世界时间或本地时间。您可以选择是否将时钟保持在协调世界协调时或本地时间，但时钟中没有显示任何信息。这是你所选择的，所以这个选项就是你如何将信息提供给时钟。</span></p>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>如果您指定了这些选项中的一个错误的<span
  lang=EN-US>(</span>或者没有指定，并且选择了错误的默认值<span lang=EN-US>)</span>，那么硬件时钟的设置和查询都将被搞砸。</span></p>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>如果您没有指定<span
  lang=EN-US>-utc</span>或<span lang=EN-US>-localtime</span>，则默认值以最后一次使用<span
  lang=EN-US>hwlock</span>设置时钟时指定的值为准<span lang=EN-US>(</span>即，<span
  lang=EN-US>hwlock</span>成功地使用<span lang=EN-US>-set</span>、<span lang=EN-US>-system
  ohc</span>或<span lang=EN-US>-</span>调整器选项运行<span lang=EN-US>)</span>，如<span
  lang=EN-US>adjtime</span>文件中所记录的。如果<span lang=EN-US>adjtime</span>文件不存在，则默认值为本地时间。</span></p>
  </td>
 </tr>
 <tr style='height:21.15pt'>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt;height:21.15pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>--noadjfile</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt;height:21.15pt'>
  <p class=MsoNormal><span style='font-family:"Microsoft YaHei";color:black'>禁用<span
  lang=EN-US>/etc/adjtime.hwlock</span>提供的工具，不使用此选项读取或写入该文件。在使用此选项时，必须指定<span
  lang=EN-US>-UTC</span>和<span lang=EN-US>--localtime</span></span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>--adjfile=ilename</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>覆盖默认的<span
  lang=EN-US>/etc/adjtime</span>文件</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>-f | --rtc=filename</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>重写默认<span
  lang=EN-US>/dev</span>文件名，在许多平台上为<span lang=EN-US>/dev/rtc</span>，但可能是<span
  lang=EN-US>/dev/rtc0</span>、<span lang=EN-US>/dev/rtc1</span>，等等。</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>--directisa</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>只有在<span
  lang=EN-US>ISA</span>机器或<span lang=EN-US>Alpha</span>上才有意义<span lang=EN-US>(</span>粗略地说，它实现了足够多的<span
  lang=EN-US>ISA</span>机器来实现<span lang=EN-US>hwlock</span>的目的<span lang=EN-US>)</span>。对于其他机器，它没有作用。这个选项告诉<span
  lang=EN-US>hwlock</span>使用显式<span lang=EN-US>I/O</span>指令来访问硬件时钟。如果没有这个选项，<span
  lang=EN-US>hwlock</span>就会尝试。若要使用<span lang=EN-US>/dev/rtc</span>设备<span
  lang=EN-US>(</span>假定它由<span lang=EN-US>RTC</span>设备驱动程序驱动<span lang=EN-US>)</span>，如果它无法打开设备<span
  lang=EN-US>(</span>用于读取<span lang=EN-US>)</span>，它将使用显式<span lang=EN-US>I/O</span>指令。</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>--badyear</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>表示硬件时钟无法存储超出<span
  lang=EN-US>1994-1999</span>年范围的年份。在一些<span lang=EN-US>BIOSes(</span>几乎所有在<span
  lang=EN-US>4/26/94</span>至<span lang=EN-US>5/31/95</span>之间制造的<span
  lang=EN-US>BIOSes)</span>中都存在一个问题，在这些<span lang=EN-US>BIOSes</span>中，它们无法处理<span
  lang=EN-US>1999</span>年之后的年份。如果试图将世纪价值设置为小于<span lang=EN-US>94(</span>或<span
  lang=EN-US>95 in)</span>的值。在某些情况下，实际设置的值为<span lang=EN-US>94(</span>或<span
  lang=EN-US>95)</span>，因此，如果您有这些机器中的一台，则<span lang=EN-US>hwlock</span>不能在<span
  lang=EN-US>1999</span>年之后设置，也不能以正常的方式使用时钟的值作为真正的时间。</span></p>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>为了弥补这一点<span
  lang=EN-US>(</span>没有<span lang=EN-US>BIOS</span>更新，这肯定更好<span lang=EN-US>)</span>，请始终使用<span
  lang=EN-US>-</span>如果您有这些机器中的一台，就使用<span lang=EN-US>-</span>坏年份。在<span
  lang=EN-US>adjtime</span>文件中假设日期是过去一年内的日期。要想让它发挥作用，你最好每年至少运行一次<span
  lang=EN-US>hwclock --set</span>或<span lang=EN-US>hwlock –systohc</span>。</span></p>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>虽然<span
  lang=EN-US>hwlock</span>在读取硬件时钟时忽略了年份值，但当它设置时钟时，它会设置年份值，将其设置为<span
  lang=EN-US>1995</span>、<span lang=EN-US>1996</span>、<span lang=EN-US>1997</span>或<span
  lang=EN-US>1998</span>，无论哪个年份在闰年周期中所处的位置与真正的年份相同。这样，硬件时钟就会插入。如果你让硬件时钟在没有设置的情况下运行一年以上，这个方案可能会失败，最后你可能会损失一天。</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>--srm</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal align=left style='text-align:left'><span style='font-family:
  "Microsoft YaHei";color:#333333;background:transparent'>此选项等价于<span
  lang=EN-US>--epoch=1900</span>，用于使用<span lang=EN-US>srm</span>控制台指定<span
  lang=EN-US>alphad</span>上最常见的历元。</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>--arc</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>此选项等价于<span
  lang=EN-US>--epoch=1980</span>，用于使用<span lang=EN-US>ARC</span>控制台指定<span
  lang=EN-US>ALPHS</span>上最常见的历次<span lang=EN-US>(</span>但<span lang=EN-US>Ruffans</span>有<span
  lang=EN-US>1900</span>年<span lang=EN-US>)</span>。</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>--jensen | --funky-toy</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>这两个选项指定了您拥有的<span
  lang=EN-US>Alpha</span>机器的类型。如果您没有<span lang=EN-US>Alpha</span>，则它们是无效的，如果有，它们通常是不必要的，因为<span
  lang=EN-US>hwlock</span>应该能够自行确定运行在什么上，至少在安装<span lang=EN-US>/proc</span>时是这样的。<span
  lang=EN-US>(</span>如果您发现您需要这些选项之一使<span lang=EN-US>hwlock</span>工作，请与维护人员联系，看看程序是否可以改进以自动检测您的系统。<span
  lang=EN-US>‘hwlock --debug’</span>和<span lang=EN-US>‘cat/proc/cpuinfo’</span>的输出可能会引起人们的兴趣。<span
  lang=EN-US>)</span></span></p>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>--jensen</span><span style='font-family:
  "Microsoft YaHei"'>代表运行在<span lang=EN-US>Jensen</span>模式。</span></p>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>--funky-toy</span><span
  style='font-family:"Microsoft YaHei"'>意味着在您的机器上，必须使用<span lang=EN-US>UF</span>位而不是硬件时钟中的<span
  lang=EN-US>UIP</span>位来检测时间转换。选项名中的<span lang=EN-US>“toy”</span>是指机器一年中的时间</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>--test</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>测试程序，不改变任何设置</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>--debug</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>显示大量关于<span
  lang=EN-US>hwlock</span>内部正在做什么的信息，其中一些功能是复杂的，这个输出可以帮助您理解程序是如何工作的。</span></p>
  </td>
 </tr>
</table>

<p class=MsoNormal style='line-height:200%'><span lang=EN-US style='font-family:
"Microsoft YaHei"'>&nbsp;</span></p>

<p class=MsoNormal style='line-height:200%'><b><span lang=EN-US
style='font-family:"Microsoft YaHei"'>3</span></b><b><span style='font-family:
"Microsoft YaHei"'>、说明</span></b></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
style='font-family:"Microsoft YaHei";color:black;vertical-align:sub'>一般在操作系统中都会有两个时钟，硬件时钟是主板上的定时器时钟，系统时钟是系统的内核时钟，它们相互不影响。</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
lang=EN-US style='font-family:"Microsoft YaHei";color:black;vertical-align:
sub'>1</span><span style='font-family:"Microsoft YaHei";color:black;vertical-align:
sub'>）硬件时钟</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
style='font-family:"Microsoft YaHei"'>这个时钟，运行独立于任何控制程序运行在<span lang=EN-US>CPU</span>中，甚至当机器关闭。在<span
lang=EN-US>ISA</span>系统中，这个时钟被指定为<span lang=EN-US>ISA</span>标准的一部分。控制程序可以读取或设置这个时钟为整秒，但控制程序也可以检测<span
lang=EN-US>1</span>秒时钟的边缘，因此该时钟实际上具有无限的精度。</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
style='font-family:"Microsoft YaHei"'>这种时钟通常被称为硬件时钟、实时时钟、<span lang=EN-US>RTC</span>、<span
lang=EN-US>BIOS</span>时钟和<span lang=EN-US>CMOS</span>时钟。硬件时钟以其大写的形式被<span
lang=EN-US>hwlock</span>所发明，因为其他所有的名称都不适合误导。例如，一些非<span lang=EN-US>ISA</span>系统有几个实时时钟。一个非常低功耗的<span
lang=EN-US>I2C</span>或<span lang=EN-US>SPI</span>时钟芯片可以与备用电池一起作为硬件时钟，以初始化一个功能更好的集成实时时钟，用于大多数其他用途。</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
lang=EN-US style='font-family:"Microsoft YaHei"'>2</span><span
style='font-family:"Microsoft YaHei"'>）系统时钟</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
style='font-family:"Microsoft YaHei"'>这是由<span lang=EN-US>Linux</span>内核内的时钟保持的时间，由计时器中断驱动。<span
lang=EN-US>(</span>在<span lang=EN-US>ISA</span>机器上，计时器中断是<span lang=EN-US>ISA</span>标准的一部分<span
lang=EN-US>)</span>。它只有在<span lang=EN-US>linux</span>在机器上运行时才有意义。系统时间是从<span
lang=EN-US>1970</span>年世界协调时<span lang=EN-US>(UTC)1</span>月<span lang=EN-US>1</span>日<span
lang=EN-US>00</span>：<span lang=EN-US>00</span>开始的秒数<span lang=EN-US>(</span>或者更简洁地说，是<span
lang=EN-US>1969</span>年以来的秒数<span lang=EN-US>)</span>。不过，系统时间不是整数，它实际上是无限的。系统时间是重要的时间。<span
lang=EN-US>Linux</span>系统中硬件时钟的基本目的是在<span lang=EN-US>Linux</span>不运行时保持时间。在<span
lang=EN-US>Linux</span>启动时，将系统时间从硬件时钟初始化，然后不再使用硬件时钟。请注意，在设计<span lang=EN-US>ISA</span>的<span
lang=EN-US>DOS</span>中，硬件时钟是唯一的实时时钟。</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
style='font-family:"Microsoft YaHei"'>重要的是，当系统运行时，系统时间不存在任何不连续性，比如使用<span
lang=EN-US>date</span>命令来设置它。但是，在系统运行时，您可以对硬件时钟做任何您想做的事情，而下一次<span lang=EN-US>Linux</span>启动时，它将使用硬件时钟的调整时间进行设置。</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
lang=EN-US style='font-family:"Microsoft YaHei"'>Linux</span><span
style='font-family:"Microsoft YaHei"'>内核维护系统的本地时区的概念。但是不要被误导<span lang=EN-US>-</span>几乎没有人关心内核认为它在哪个时区。相反，关心时区的程序<span
lang=EN-US>(</span>可能因为他们想为您显示本地时间<span lang=EN-US>)</span>几乎总是使用更传统的方法。确定时区：它们使用“<span
lang=EN-US>tz</span>”环境变量或“<span lang=EN-US>/usr/share/zoneinfo</span>”目录，如<span
lang=EN-US>tzset(3)</span>的手册页所解释的那样。时区值是错误的，<span lang=EN-US>vFAT</span>文件系统会在文件上报告并设置错误的时间戳。</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
style='font-family:"Microsoft YaHei"'>当您使用<span lang=EN-US>”--hctosys”</span>选项设置系统时间时，<span
lang=EN-US>hwlock</span>将内核时区设置为“<span lang=EN-US>tz</span>”或“<span lang=EN-US>/usr/share/zoneinfo</span>”所指示的值。</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
style='font-family:"Microsoft YaHei"'>时区值实际上由两部分组成：<span lang=EN-US>1)</span>字段“<span
lang=EN-US>tz_minutesWest</span>”表示本地时间<span lang=EN-US>(</span>未根据<span
lang=EN-US>DST</span>进行调整<span lang=EN-US>)</span>滞后于<span lang=EN-US>UTC</span>；<span
lang=EN-US>2)</span>字段“<span lang=EN-US>tz_dsttime</span>”，指示当前在本地有效的夏令时<span
lang=EN-US>(DST)</span>约定的类型。第二个字段不在<span lang=EN-US>Linux</span>下使用，始终为零。</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
lang=EN-US style='font-family:"Microsoft YaHei"'>3</span><span
style='font-family:"Microsoft YaHei"'>）<span lang=EN-US>hwclock</span>如何访问硬件时钟</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
lang=EN-US style='font-family:"Microsoft YaHei"'>hwlock</span><span
style='font-family:"Microsoft YaHei"'>使用多种不同的方法来获取和设置硬件时钟值，最常见的方法是对设备特殊文件“<span
lang=EN-US>/dev/rtc</span>”执行<span lang=EN-US>I/O</span>操作，假定该文件是由<span
lang=EN-US>rtc</span>设备驱动程序驱动的。然而，这种方法并不总是可用的。首先，<span lang=EN-US>rtc</span>驱动程序是<span
lang=EN-US>linux</span>中比较新的一种。此外，虽然有一些版本的<span lang=EN-US>rtc</span>驱动程序可以在<span
lang=EN-US>decalpha</span>上工作，但似乎有大量的<span lang=EN-US>alpha</span>无法工作<span
lang=EN-US>(</span>常见的症状是时钟挂起<span lang=EN-US>)</span>。此外，最近的<span lang=EN-US>linux</span>系统对<span
lang=EN-US>rtc</span>有更多的通用支持，甚至支持不止一个的系统，所以您可能需要通过指定<span lang=EN-US>/dev/rtc
0</span>或<span lang=EN-US>/dev/rtc 1</span>来覆盖默认值。</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
style='font-family:"Microsoft YaHei"'>在旧系统中，访问硬件时钟的方法取决于系统硬件。</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
style='font-family:"Microsoft YaHei"'>在<span lang=EN-US>ISA</span>系统中，<span
lang=EN-US>hwlock</span>通过对端口<span lang=EN-US>0x70</span>和<span lang=EN-US>0x71</span>进行<span
lang=EN-US>I/O</span>操作，可以直接访问构成时钟的<span lang=EN-US>“CMOS</span>存储器<span
lang=EN-US>”</span>寄存器。它使用实际的<span lang=EN-US>I/O</span>指令，因此只有在超级用户有效用户<span
lang=EN-US>ID</span>的情况下才能这样做。<span lang=EN-US>(</span>对于<span lang=EN-US>jensen
Alpha</span>，<span lang=EN-US>hwlock</span>无法执行这些<span lang=EN-US>I/O</span>指令，因此它使用设备文件“<span
lang=EN-US>/dev/port</span>”，它提供了与<span lang=EN-US>I/O</span>子系统几乎一样低的接口<span
lang=EN-US>)</span>。这是一种非常糟糕的访问时钟的方法，因为用户空间程序通常不应该进行直接<span lang=EN-US>I/O</span>和禁用中断。但是在<span
lang=EN-US>ISA</span>和<span lang=EN-US>Alpha</span>系统中，这是唯一的方式。</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
style='font-family:"Microsoft YaHei"'>在<span lang=EN-US>m68k</span>系统上，<span
lang=EN-US>hwlock</span>可以通过控制台驱动程序访问时钟，通过设备文件“<span lang=EN-US>/dev/tty1</span>”访问时钟。</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
lang=EN-US style='font-family:"Microsoft YaHei"'>hwlock</span><span
style='font-family:"Microsoft YaHei"'>尝试使用文件“<span lang=EN-US>/dev/rtc</span>”。如果内核没有编译“<span
lang=EN-US>/dev/rtc</span>”，或者它无法打开“<span lang=EN-US>/dev/rtc</span>”，那么<span
lang=EN-US>hwlock</span>将返回到另一种方法<span lang=EN-US>(</span>如果可用的话<span
lang=EN-US>)</span>。在<span lang=EN-US>ISA</span>或<span lang=EN-US>Alpha</span>计算机上，您可以强制<span
lang=EN-US>hwclock</span>使用<span lang=EN-US>CMOS</span>寄存器的直接操作，而无需通过指定<span
lang=EN-US>“--directisa”</span>选项。</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
lang=EN-US style='font-family:"Microsoft YaHei"'>4</span><span
style='font-family:"Microsoft YaHei"'>）校准功能<span lang=EN-US>adjust</span></span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
style='font-family:"Microsoft YaHei"'>硬件时钟通常不是很精确，但是它的许多不准确是完全可以预测的，它每天得到或失去相同的时间。这被称为系统漂移。<span
lang=EN-US>hwlock</span>的<span lang=EN-US>“</span>调整<span lang=EN-US>”</span>功能允许您进行系统校正以纠正系统漂移。它的工作方式如下：<span
lang=EN-US>hwlock</span>保存了一个文件“<span lang=EN-US>/etc/adjtime</span>”，它保存了一些历史信息。</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
style='font-family:"Microsoft YaHei"'>假设您从没有<span lang=EN-US>adjtime</span>文件开始，发出<span
lang=EN-US>hwlock-set</span>命令将硬件时钟设置为真实的当前时间。<span lang=EN-US>hwlock</span>创建<span
lang=EN-US>adjtime</span>文件，并在其中记录当前时间，作为最后一次校准时钟。<span lang=EN-US>5</span>天后，时钟增加了<span
lang=EN-US>10</span>秒，因此您可以发出另一个<span lang=EN-US>“hwlock --set”</span>命令来设置它。返回<span
lang=EN-US>10</span>秒。<span lang=EN-US>hwlock</span>更新<span lang=EN-US>adjtime</span>文件，显示当前时间作为最后一次校准时钟，并以系统漂移速率记录每天<span
lang=EN-US>2</span>秒。<span lang=EN-US>24</span>小时过去，然后发出<span lang=EN-US>“hwlock
--adjust”</span>命令。<span lang=EN-US>hwlock</span>查阅<span lang=EN-US>adjtime</span>文件，看到时钟离开时每天增加<span
lang=EN-US>2</span>秒。一个人呆了整整一天。所以它从硬件时钟中减去<span lang=EN-US>2</span>秒。然后，它记录当前时间作为最后一次调整时钟的时间。又过了<span
lang=EN-US>24</span>小时，你又发出了另一个<span lang=EN-US>“hwclock --adjust”</span>指令。<span
lang=EN-US>hwclock</span>做了同样的事情：减去<span lang=EN-US>2</span>秒，用当前时间更新<span
lang=EN-US>adjtime</span>文件，这是最后一次调整时钟。</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
style='font-family:"Microsoft YaHei"'>每次您校准时钟<span lang=EN-US>(</span>使用<span
lang=EN-US>--set</span>或<span lang=EN-US>—systohc)</span>时，<span lang=EN-US>hwlock</span>根据上次校准的时间、上次调整后的时间、在任何中间的调整中假定的漂移率以及时钟当前的关闭量，重新计算系统漂移率。在<span
lang=EN-US>hwclock</span>使用的任何时候，都会出现少量的误差，因此它不会进行小于<span lang=EN-US>1</span>秒的调整。稍后，当您再次请求调整时，累积漂移将超过<span
lang=EN-US>1</span>秒钟，而<span lang=EN-US>hwlock</span>则会进行调整。</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
style='font-family:"Microsoft YaHei"'>在系统启动时，在“<span lang=EN-US>hwlock --hctosys</span>”之前进行<span
lang=EN-US>hwlock</span>的调整是很好的，并且在系统通过<span lang=EN-US>cron</span>运行时也可以定期进行调整。</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
style='font-family:"Microsoft YaHei"'>虽然<span lang=EN-US>adjtime</span>文件的命名仅仅是为了控制时间调整的历史记录，但它实际上包含了<span
lang=EN-US>hwlock</span>在从一个调用到下一个调用时记忆信息时使用的其他信息。<span lang=EN-US>adjtime</span>文件的格式是<span
lang=EN-US>ASCII</span>：</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
style='font-family:"Microsoft YaHei"'>第<span lang=EN-US>1</span>行的<span
lang=EN-US>3</span>个数字数字，用空格隔开，分别代表：<span lang=EN-US>a)</span>系统漂移率，每天以秒为单位，浮点小数点；<span
lang=EN-US>b)</span>自<span lang=EN-US>1969</span>年世界协调时以来最近调整或校准的秒数，小数整数；<span
lang=EN-US>c)</span>零<span lang=EN-US>(</span>与时钟<span lang=EN-US>(8)</span>兼容<span
lang=EN-US>)</span>为十进制整数。</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
style='font-family:"Microsoft YaHei"'>第<span lang=EN-US>2</span>行一个数字，代表自<span
lang=EN-US>1969</span>年世界协调时以来最近一次校准产生的秒数。如果还没有校准，或者已知任何先前的校准都是没有意义的，那么值就是<span
lang=EN-US>0(</span>例如，因为在校准之后，硬件时钟已经被找到，不包含有效时间<span lang=EN-US>)</span>。这是一个十进制整数。</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
style='font-family:"Microsoft YaHei"'>第<span lang=EN-US>3</span>行是<span
lang=EN-US>“utc”</span>或<span lang=EN-US>“local”</span>。指示硬件时钟是设置为协调世界时间还是设置为本地时间。</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
lang=EN-US style='font-family:"Microsoft YaHei"'>5</span><span
style='font-family:"Microsoft YaHei"'>）内核如何自动同步硬件时钟</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
style='font-family:"Microsoft YaHei"'>在某些系统中，您应该注意到硬件时钟保持同步的另一种方式。<span
lang=EN-US>Linux</span>内核有一种模式，它每<span lang=EN-US>11</span>分钟将系统时间复制一次到硬件时钟。这是一个很好的模式，当您使用一些复杂的东西，比如<span
lang=EN-US>NTP</span>来保持系统时间同步时。<span lang=EN-US>(NTP</span>是一种保持系统时间同步的方法，它可以与网络上的某个时间服务器或连接到您的系统的无线电时钟保持同步。参见<span
lang=EN-US>RFC 1305)</span>。</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
style='font-family:"Microsoft YaHei"'>这个模式<span lang=EN-US>(</span>我们称之为<span
lang=EN-US>“11</span>分钟模式<span lang=EN-US>”)</span>是关闭的，直到有东西打开它。<span
lang=EN-US>ntp</span>守护进程<span lang=EN-US>xntpd</span>就可以打开它。您可以通过运行任何东西来关闭它，包括<span
lang=EN-US>“hwlock --hctosys”</span>，它以老式的方式设置系统时间。</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
style='font-family:"Microsoft YaHei"'>如果你的系统以<span lang=EN-US>11</span>分钟的模式运行，不要使用<span
lang=EN-US>“hwlock --adjust”</span>或<span lang=EN-US>“hwlock-hctosys”</span>。在启动时使用<span
lang=EN-US>“hwlock --hctosys”</span>来获得一个合理的系统时间是可以接受的，直到您的系统能够运行为止。从外部源设置系统时间并启动<span
lang=EN-US>11</span>分钟模式</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
lang=EN-US style='font-family:"Microsoft YaHei"'>&nbsp;</span></p>

<p class=MsoNormal style='line-height:200%'><b><span lang=EN-US
style='font-family:"Microsoft YaHei"'>4</span></b><b><span style='font-family:
"Microsoft YaHei"'>、实例</span></b></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
lang=EN-US style='font-family:"Microsoft YaHei"'>1</span><span
style='font-family:"Microsoft YaHei"'>）不适用任何参数，直接查看硬件时钟</span></p>

<table class=a0 border=1 cellspacing=0 cellpadding=0 width="95%"
 style='width:95.0%;margin-left:24.1pt;border-collapse:collapse;border:none'>
 <tr style='height:14.9pt'>
  <td width=836 valign=top style='width:836.15pt;border:solid windowtext 1.0pt;
  background:#E7E6E6;padding:0cm 5.4pt 0cm 5.4pt;height:14.9pt'>
  <p class=MsoNormal style='line-height:200%'><code><span lang=EN-US
  style='font-size:10.5pt;line-height:200%;font-family:Menlo'>[root@localhost
  ntop-4.0.1]# <b>hwclock</b></span></code></p>
  <p class=MsoNormal style='line-height:200%'><code><span lang=EN-US
  style='font-size:10.5pt;line-height:200%;font-family:Menlo'>2018</span></code><code><span
  style='font-size:10.5pt;line-height:200%;font-family:DengXian'>年</span></code><code><span
  lang=EN-US style='font-size:10.5pt;line-height:200%;font-family:Menlo'>08</span></code><code><span
  style='font-size:10.5pt;line-height:200%;font-family:DengXian'>月</span></code><code><span
  lang=EN-US style='font-size:10.5pt;line-height:200%;font-family:Menlo'>23</span></code><code><span
  style='font-size:10.5pt;line-height:200%;font-family:DengXian'>日</span></code><code><span
  style='font-size:10.5pt;line-height:200%;font-family:Menlo'> </span></code><code><span
  style='font-size:10.5pt;line-height:200%;font-family:DengXian'>星期四</span></code><code><span
  lang=EN-US style='font-size:10.5pt;line-height:200%;font-family:Menlo'> 15</span></code><code><span
  style='font-size:10.5pt;line-height:200%;font-family:DengXian'>时</span></code><code><span
  lang=EN-US style='font-size:10.5pt;line-height:200%;font-family:Menlo'>01</span></code><code><span
  style='font-size:10.5pt;line-height:200%;font-family:DengXian'>分</span></code><code><span
  lang=EN-US style='font-size:10.5pt;line-height:200%;font-family:Menlo'>28</span></code><code><span
  style='font-size:10.5pt;line-height:200%;font-family:DengXian'>秒</span></code><code><span
  lang=EN-US style='font-size:10.5pt;line-height:200%;font-family:Menlo'> 
  -0.577410 seconds</span></code></p>
  </td>
 </tr>
</table>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
lang=EN-US style='font-family:"Microsoft YaHei"'>2</span><span
style='font-family:"Microsoft YaHei"'>）设置硬件时钟</span></p>

<table class=a0 border=1 cellspacing=0 cellpadding=0 width="95%"
 style='width:95.0%;margin-left:24.1pt;border-collapse:collapse;border:none'>
 <tr style='height:14.9pt'>
  <td width=836 valign=top style='width:836.15pt;border:solid windowtext 1.0pt;
  background:#E7E6E6;padding:0cm 5.4pt 0cm 5.4pt;height:14.9pt'>
  <p class=MsoNormal style='line-height:200%'><code><span lang=EN-US
  style='font-size:10.5pt;line-height:200%;font-family:Menlo'>[root@localhost
  ntop-4.0.1]# <b>hwclock --set --date=&quot;0904&quot;    //</b></span></code><code><b><span
  style='font-size:10.5pt;line-height:200%;font-family:DengXian'>设置硬件时钟，需要</span></b></code><code><b><span
  lang=EN-US style='font-size:10.5pt;line-height:200%;font-family:Menlo'>date</span></b></code><code><b><span
  style='font-size:10.5pt;line-height:200%;font-family:DengXian'>参数来配合使用</span></b></code></p>
  <p class=MsoNormal style='line-height:200%'><code><span lang=EN-US
  style='font-size:10.5pt;line-height:200%;font-family:Menlo'>[root@localhost
  ntop-4.0.1]# <b>hwclock</b></span></code></p>
  <p class=MsoNormal style='line-height:200%'><code><span lang=EN-US
  style='font-size:10.5pt;line-height:200%;font-family:Menlo'>2018</span></code><code><span
  style='font-size:10.5pt;line-height:200%;font-family:DengXian'>年</span></code><code><span
  lang=EN-US style='font-size:10.5pt;line-height:200%;font-family:Menlo'>09</span></code><code><span
  style='font-size:10.5pt;line-height:200%;font-family:DengXian'>月</span></code><code><span
  lang=EN-US style='font-size:10.5pt;line-height:200%;font-family:Menlo'>04</span></code><code><span
  style='font-size:10.5pt;line-height:200%;font-family:DengXian'>日</span></code><code><span
  style='font-size:10.5pt;line-height:200%;font-family:Menlo'> </span></code><code><span
  style='font-size:10.5pt;line-height:200%;font-family:DengXian'>星期二</span></code><code><span
  lang=EN-US style='font-size:10.5pt;line-height:200%;font-family:Menlo'> 09</span></code><code><span
  style='font-size:10.5pt;line-height:200%;font-family:DengXian'>时</span></code><code><span
  lang=EN-US style='font-size:10.5pt;line-height:200%;font-family:Menlo'>04</span></code><code><span
  style='font-size:10.5pt;line-height:200%;font-family:DengXian'>分</span></code><code><span
  lang=EN-US style='font-size:10.5pt;line-height:200%;font-family:Menlo'>09</span></code><code><span
  style='font-size:10.5pt;line-height:200%;font-family:DengXian'>秒</span></code><code><span
  lang=EN-US style='font-size:10.5pt;line-height:200%;font-family:Menlo'> 
  -0.479386 seconds</span></code></p>
  </td>
 </tr>
</table>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
lang=EN-US style='font-family:"Microsoft YaHei"'>3</span><span
style='font-family:"Microsoft YaHei"'>）将硬件时钟设置成本地时间格式</span></p>

<table class=a0 border=1 cellspacing=0 cellpadding=0 width="95%"
 style='width:95.0%;margin-left:24.1pt;border-collapse:collapse;border:none'>
 <tr style='height:14.9pt'>
  <td width=836 valign=top style='width:836.15pt;border:solid windowtext 1.0pt;
  background:#E7E6E6;padding:0cm 5.4pt 0cm 5.4pt;height:14.9pt'>
  <p class=MsoNormal style='line-height:200%'><code><span lang=EN-US
  style='font-size:10.5pt;line-height:200%;font-family:Menlo'>[root@localhost
  ntop-4.0.1]# <b>hwclock --localtime</b></span></code></p>
  <p class=MsoNormal style='line-height:200%'><code><span lang=EN-US
  style='font-size:10.5pt;line-height:200%;font-family:Menlo'>2018</span></code><code><span
  style='font-size:10.5pt;line-height:200%;font-family:DengXian'>年</span></code><code><span
  lang=EN-US style='font-size:10.5pt;line-height:200%;font-family:Menlo'>09</span></code><code><span
  style='font-size:10.5pt;line-height:200%;font-family:DengXian'>月</span></code><code><span
  lang=EN-US style='font-size:10.5pt;line-height:200%;font-family:Menlo'>04</span></code><code><span
  style='font-size:10.5pt;line-height:200%;font-family:DengXian'>日</span></code><code><span
  style='font-size:10.5pt;line-height:200%;font-family:Menlo'> </span></code><code><span
  style='font-size:10.5pt;line-height:200%;font-family:DengXian'>星期二</span></code><code><span
  lang=EN-US style='font-size:10.5pt;line-height:200%;font-family:Menlo'> 01</span></code><code><span
  style='font-size:10.5pt;line-height:200%;font-family:DengXian'>时</span></code><code><span
  lang=EN-US style='font-size:10.5pt;line-height:200%;font-family:Menlo'>05</span></code><code><span
  style='font-size:10.5pt;line-height:200%;font-family:DengXian'>分</span></code><code><span
  lang=EN-US style='font-size:10.5pt;line-height:200%;font-family:Menlo'>46</span></code><code><span
  style='font-size:10.5pt;line-height:200%;font-family:DengXian'>秒</span></code><code><span
  lang=EN-US style='font-size:10.5pt;line-height:200%;font-family:Menlo'> 
  -0.462990 seconds</span></code></p>
  </td>
 </tr>
</table>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
lang=EN-US style='font-family:"Microsoft YaHei"'>4</span><span
style='font-family:"Microsoft YaHei"'>）将硬件时钟设置成系统时间</span></p>

<table class=a0 border=1 cellspacing=0 cellpadding=0 width="95%"
 style='width:95.0%;margin-left:24.1pt;border-collapse:collapse;border:none'>
 <tr style='height:14.9pt'>
  <td width=415 valign=top style='width:414.5pt;border:solid windowtext 1.0pt;
  background:#E7E6E6;padding:0cm 5.4pt 0cm 5.4pt;height:14.9pt'>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-size:10.5pt;line-height:200%;font-family:Menlo'>[root@localhost
  ntop-4.0.1]# <b>date      //</b></span><b><span style='font-size:10.5pt;
  line-height:200%;font-family:"Microsoft YaHei"'>查看当前系统时间</span></b></p>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-size:10.5pt;line-height:200%;font-family:Menlo'>2018</span><span
  style='font-size:10.5pt;line-height:200%;font-family:"Microsoft YaHei"'>年</span><span
  lang=EN-US style='font-size:10.5pt;line-height:200%;font-family:Menlo'> 09</span><span
  style='font-size:10.5pt;line-height:200%;font-family:"Microsoft YaHei"'>月</span><span
  lang=EN-US style='font-size:10.5pt;line-height:200%;font-family:Menlo'> 04</span><span
  style='font-size:10.5pt;line-height:200%;font-family:"Microsoft YaHei"'>日</span><span
  style='font-size:10.5pt;line-height:200%;font-family:Menlo'> </span><span
  style='font-size:10.5pt;line-height:200%;font-family:"Microsoft YaHei"'>星期二</span><span
  lang=EN-US style='font-size:10.5pt;line-height:200%;font-family:Menlo'>
  12:25:15 CST</span></p>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-size:10.5pt;line-height:200%;font-family:Menlo'>[root@localhost
  ntop-4.0.1]# <b>hwclock –w  //</b></span><b><span style='font-size:10.5pt;
  line-height:200%;font-family:"Microsoft YaHei"'>将硬件时钟设置为系统时间</span></b></p>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-size:10.5pt;line-height:200%;font-family:Menlo'>[root@localhost
  ntop-4.0.1]#<b> hwclock     //</b></span><b><span style='font-size:10.5pt;
  line-height:200%;font-family:"Microsoft YaHei"'>查看硬件时钟</span></b></p>
  <p class=MsoNormal style='line-height:200%'><span lang=EN-US
  style='font-size:10.5pt;line-height:200%;font-family:Menlo'>2018</span><span
  style='font-size:10.5pt;line-height:200%;font-family:"Microsoft YaHei"'>年</span><span
  lang=EN-US style='font-size:10.5pt;line-height:200%;font-family:Menlo'>09</span><span
  style='font-size:10.5pt;line-height:200%;font-family:"Microsoft YaHei"'>月</span><span
  lang=EN-US style='font-size:10.5pt;line-height:200%;font-family:Menlo'>04</span><span
  style='font-size:10.5pt;line-height:200%;font-family:"Microsoft YaHei"'>日</span><span
  style='font-size:10.5pt;line-height:200%;font-family:Menlo'> </span><span
  style='font-size:10.5pt;line-height:200%;font-family:"Microsoft YaHei"'>星期二</span><span
  lang=EN-US style='font-size:10.5pt;line-height:200%;font-family:Menlo'> 12</span><span
  style='font-size:10.5pt;line-height:200%;font-family:"Microsoft YaHei"'>时</span><span
  lang=EN-US style='font-size:10.5pt;line-height:200%;font-family:Menlo'>25</span><span
  style='font-size:10.5pt;line-height:200%;font-family:"Microsoft YaHei"'>分</span><span
  lang=EN-US style='font-size:10.5pt;line-height:200%;font-family:Menlo'>48</span><span
  style='font-size:10.5pt;line-height:200%;font-family:"Microsoft YaHei"'>秒</span><span
  lang=EN-US style='font-size:10.5pt;line-height:200%;font-family:Menlo'> 
  -0.263687 seconds</span></p>
  </td>
 </tr>
</table>

<p class=MsoNormal style='line-height:200%'><span lang=EN-US style='font-family:
"Microsoft YaHei"'>&nbsp;</span></p>

<p class=MsoNormal style='line-height:200%'><span lang=EN-US style='font-family:
"Microsoft YaHei"'>&nbsp;</span></p>

<p class=MsoNormal style='line-height:200%'><span lang=EN-US style='font-family:
"Microsoft YaHei"'>&nbsp;</span></p>

<p class=MsoNormal align=center style='text-align:center;line-height:200%'><span
lang=EN-US style='font-family:"Microsoft YaHei"'>Copyright@david 
zhytwj2018@163.com</span></p>

</div>

</body>

</html>
